<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
 <!-- 最新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="bootstrap-3.0.3/css/bootstrap.min.css">
<!-- 可选的Bootstrap主题文件（一般不用引入） -->
<link rel="stylesheet" href="bootstrap-3.0.3/css/bootstrap.theme.min.css">
<link rel="stylesheet" href="bootstrap-3.0.3/css/bootstrap.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="bootstrap-3.0.3/js/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="bootstrap-3.0.3/js/bootstrap.min.js"></script>

<link rel="stylesheet" href="bootstrap-3.0.3/css/bootstrap.css">
<style type="text/css">
	
	form div{
		margin-top: 20px;
	}
	
	#addapp{
		margin-left: 100px;
		margin-right: 20px;
	}
</style>
<script type="text/javascript" src="js/jquery-1.12.4.js"></script>
<script type="text/javascript">	
	$(function(){
		
		$("#oneselect").change(function(){
			$.getJSON("twoAll",{parentId:$(this).val()},function(data){
				
				$("#towselect").html("");
				$.each(data,function(i,item){	
					
					$("<option value='"+item["id"]+"'>"+item["categoryName"]+"</option>").appendTo("#towselect");
					
				})
			})
		})
		$("#towselect").change(function(){
			
			$.getJSON("threeAll",{parentId:$(this).val()},function(data){
				
				$("#threeselect").html("");
				$.each(data,function(i,item){	
					
					$("<option value='"+item["id"]+"'>"+item["categoryName"]+"</option>").appendTo("#threeselect");
					
				})
			})
		})
		
	})
</script>
</head>
<body>
	<div style="width: 400px;height:1000px;margin-left: 50px;margin-top: 30px">
	<form action="doappupdate"  method="post" style="width: 400px;margin-left: 500px">
	<input type="hidden" name="id" value="${appInfo.id}"/>
		<div class="input-group" >
			<span class="input-group-addon">软件名称*</span> <input type="text" value="${appInfo.softwareName}" name="softwareName"
				class="form-control" placeholder="请输入软件名称">
		</div>
		<div class="input-group" >
			<span class="input-group-addon">APK名称*</span> <input type="text"  value="${appInfo.aPKName}" name="aPKName"
				class="form-control" placeholder="请输入APK名称">
		</div>
		<div class="input-group" >
			<span class="input-group-addon">支持ROM*</span> <input type="text" value="${appInfo.supportROM}" name="supportROM"
				class="form-control" placeholder="请输入支持的ROM">
		</div>
		<div class="input-group" >
			<span class="input-group-addon">界面语言*</span> <input type="text"  value="${appInfo.interfaceLanguage}"  name="interfaceLanguage"
				class="form-control" placeholder="请输入软件支持的界面语言">
		</div>
		<div class="input-group">
			<span class="input-group-addon">软件大小*</span> <input type="text" value="${appInfo.softwareSize}" name="softwareSize"
				class="form-control" placeholder="请输入软件大小，单位为Mb"">
		</div>
		<div class="input-group">
			<span class="input-group-addon">下载次数*</span> <input type="text" value="${appInfo.downloads}" name="downloads"
				class="form-control" placeholder="请输入下载次数">
		</div>
		<div class="input-group">
			<span class="input-group-addon">所属平台*</span><select name="flatformId" class="form-control"><option value="0">请选择</option>
		<c:forEach items="${flatformList}" var="temp">
		
			<option <c:if test="${appInfo.flatformId==temp.valueId}">selected="selected"</c:if>  value="${temp.valueId}">
				${temp.valueName}	
			</option>
		</c:forEach></select>
		</div>
		<div class="input-group">
			<span class="input-group-addon">一级分类*</span> <select name="categoryLevel1" class="form-control"  id="oneselect" ><option value="0">请选择</option>
			<c:forEach var="c" items="${listone }" varStatus="i">
				<option value="${ c.id}" selected="selected">${c.categoryName}</option>	
			</c:forEach>
			</select>
		</div>
		<div class="input-group">
			<span class="input-group-addon">二级分类*</span> <select name="categoryLevel2" class="form-control" id="towselect">
				</select>
		</div>
		<div class="input-group">
			<span class="input-group-addon">三级分类*</span><select name="categoryLevel3" class="form-control" id="threeselect">
			</select>
		</div>
		<div class="input-group">
			<span class="input-group-addon">APP状态*</span><select name="status" class="form-control">
		<c:forEach items="${statusList}" var="temp">
			<option <c:if test="${appInfo.status==temp.valueId}">selected="selected"</c:if> value="${temp.valueId}">
				${temp.valueName}
			</option>
		</c:forEach></select>
		</div>
		
		
		<div class="input-group">
			<span class="input-group-addon">应用简介*</span> <textarea class="form-control" value="${appInfo.appInfo}" name="appInfo"
			 rows="3"></textarea>
		</div>
		<div class="input-group">
			<span class="input-group-addon">LOGO图片*</span> <img alt="test" src="dsfa">
		</div>
		
		<div>
		<a href="home"><input  <c:if test="${appInfo.status==3}">type="button"</c:if> <c:if test="${appInfo.status!=3}">type="hidden"</c:if>  id="addapp" class="btn btn-primary" value="添加并且审核"></a>
		<input type="submit" class="btn btn-default" value="保存" style="margin-left: 200px">
		<a href="home"><input type="button" class="btn btn-primary" value="返回"></a>
		</div>
	</form>
	</div>
</body>
</html>